function display(id, input, output) {
    var str = document.getElementById(input).value;
    var outnode = document.getElementById(output);
    var n = outnode.childNodes.length;
    for (var i=0; i<n; i++)
        outnode.removeChild(outnode.firstChild);
    outnode.appendChild(document.createTextNode("amath Y" + id + " = " + str + " endamath"));
    AMprocessNode(outnode);
}